package org.crackjack.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "appointments")
public class Appointment extends Identify implements Serializable {

    private static final long serialVersionUID = -5918857725187646437L;
    private String name;
    private String description;
    private Double rating;
//    private Location location;
    private Category category;
//    private List<Tag> tags;
    private Profile appointmentOwner;

//    private Schedule schedule;

    public Appointment() {

    }

    @Column(name = "appointment_name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "appointment_description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Column(name = "appointment_rating")
    public Double getRating() {
        return rating;
    }

    public void setRating(Double rating) {
        this.rating = rating;
    }

//    @OneToOne(cascade = CascadeType.ALL)
//    @Column(name = "location")
//    public Location getLocation() {
//        return location;
//    }
//
//    public void setLocation(Location location) {
//        this.location = location;
//    }

    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "category_id")
    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

//    @OneToMany(cascade = CascadeType.ALL, mappedBy = "appointments")
//    public List<Tag> getTags() {
//        return tags;
//    }
//
//    public void setTags(List<Tag> tags) {
//        this.tags = tags;
//    }

    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "profile_id")
    public Profile getAppointmentOwner() {
        return appointmentOwner;
    }

    public void setAppointmentOwner(Profile appointmentOwner) {
        this.appointmentOwner = appointmentOwner;
    }

//    @OneToOne(cascade = CascadeType.ALL)
//    @Column(name = "schedule")
//    public Schedule getSchedule() {
//        return schedule;
//    }
//
//    public void setSchedule(Schedule schedule) {
//        this.schedule = schedule;
//    }

    @Override
    @Id
    @GeneratedValue
    @Column(name = "appointment_id")
    public Long getId() {
        return super.getId();
    }

}
